-
Notifications
You must be signed in to change notification settings - Fork 696
include metric name in annotations from histogram_quantile if delayed… #13905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
include metric name in annotations from histogram_quantile if delayed… #13905
Conversation
fionaliao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have these test cases been disabled? Weren't they previously passing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The TestEliminateDeduplicateAndMergeOptimizationWithDelayedNameRemovalDisabled() test case fails on this upstream file because it runs with delated name removal disabled.
Rather then disable the tests I add another Skip inside this test for the specific file. Note that the tests have been copied into the 2 new "ours" files, so we still get the same test coverage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So ours/native_histograms_delayed_name_removal_enabled.test should be identical to upstream/native_histograms.test? If so, do we need the copy in ours?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only copied out the tests relevant to the new files. So the file is not identical.
Since we will uncomment the Unsupported by streaming engine from the upstream file, I'll remove the native_histograms_delayed_name_removal_enabled.test as this will not be needed.
We will just keep the _disabled.test file.
tacole02
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changelog LGTM
| data: mixedClassicHistograms, | ||
| expr: `histogram_quantile(0.5, series{host="d"})`, | ||
| expectedInfoAnnotations: []string{`PromQL info: input to histogram_quantile needed to be fixed for monotonicity (see https://prometheus.io/docs/prometheus/latest/querying/functions/#histogram_quantile) (1:25)`}, | ||
| expectedInfoAnnotationsDelayedNameRemovalEnabled: []string{`PromQL info: input to histogram_quantile needed to be fixed for monotonicity (see https://prometheus.io/docs/prometheus/latest/querying/functions/#histogram_quantile) for metric name "series" (1:25)`}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realise this isn't something we can control, but I find the expression here hard to follow - the "for metric name ..." bit seems out of place after the parentheses, it fits better before the parentheses to me.
Perhaps something to change upstream?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which ones do you like;
The histogram_quantile input for metric "series" was corrected to enforce monotonicity (1:25) - see ....The histogram_quantile input for metric "series" was fixed to enforce monotonicity (1:25) - see ....Corrected non-monotonic histogram_quantile input for metric "series" (1:25) - see ....Fixed non-monotonic histogram_quantile input for metric "series" (1:25) - see ....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with tweaking the old structure:
input to histogram_quantile needed to be fixed for monotonicity for metric name "series" (see https://prometheus.io/docs/prometheus/latest/querying/functions/#histogram_quantile)
pkg/streamingpromql/optimize/plan/eliminate_deduplicate_and_merge_test.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So ours/native_histograms_delayed_name_removal_enabled.test should be identical to upstream/native_histograms.test? If so, do we need the copy in ours?
|
@charleskorn Thanks for your feedback and suggestions. Do you have any other feedback for this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because the Cursor GitHub App does not have access to this repository. If the app is installed on your organization with "selected repositories", make sure this repository is included in the selection.
pkg/streamingpromql/optimize/plan/eliminate_deduplicate_and_merge_test.go
Outdated
Show resolved
Hide resolved
pkg/streamingpromql/testdata/ours/native_histograms_delayed_name_removal_enabled.test
Outdated
Show resolved
Hide resolved
| data: mixedClassicHistograms, | ||
| expr: `histogram_quantile(0.5, series{host="d"})`, | ||
| expectedInfoAnnotations: []string{`PromQL info: input to histogram_quantile needed to be fixed for monotonicity (see https://prometheus.io/docs/prometheus/latest/querying/functions/#histogram_quantile) (1:25)`}, | ||
| expectedInfoAnnotationsDelayedNameRemovalEnabled: []string{`PromQL info: input to histogram_quantile needed to be fixed for monotonicity (see https://prometheus.io/docs/prometheus/latest/querying/functions/#histogram_quantile) for metric name "series" (1:25)`}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with tweaking the old structure:
input to histogram_quantile needed to be fixed for monotonicity for metric name "series" (see https://prometheus.io/docs/prometheus/latest/querying/functions/#histogram_quantile)
|
@charleskorn The un-necessary test file has been removed and the test string updated. Anything else you can see needs addressing? |
charleskorn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo last remaining reference to deleted test file:
What this PR does
Now that MQE supports delayed name removal, it is possible to include the metric name in
histogram_quantile()warning and info annotations.This brings parity to the Prometheus implementation.
The metric names are only included in the relevant warning/info annotations if
EnableDelayedNameRemovalis enabled.Which issue(s) this PR fixes or relates to
Fixes #3299
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]. If changelog entry is not needed, please add thechangelog-not-neededlabel to the PR.about-versioning.mdupdated with experimental features.Note
Adds metric names to
histogram_quantilewarning/info annotations whenEnableDelayedNameRemovalis on, aligning with Prometheus behavior.ours/native_histograms_delayed_name_removal_disabled.testand enables related upstream tests; updates optimizer test skips accordinglyCHANGELOG.mdwith enhancement entryWritten by Cursor Bugbot for commit fe279ba. This will update automatically on new commits. Configure here.